# -*-* encoding:UTF-8 -*-
# author : mengy
# date   : 2018/11/22

import json

data = [{'a': 1, 'b': 2, 'c': 3, 'd': 4}]

print (json.dumps(data))
print (json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')))

# jsonStr = "{'a': 1, 'b': 2, 'c': 3, 'd': 4}"
jsonStr = '{"a": 1, "b": 2, "c": 3, "d": 4}'

print (json.loads(jsonStr))
